﻿using System.IO;

namespace PS.Utils.FPRPC
{
    public static class StreamUtil
    {
        public static void CopyTo(this Stream from, Stream to)
        {
            byte[] buffer = new byte[4096];

            int bytesRead;
            do
            {
                bytesRead = from.Read(buffer, 0, buffer.Length);
                to.Write(buffer, 0, bytesRead);
            } while (bytesRead != 0);
        }
    }
}